/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.com.aptech.msh.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author trietto
 */
@Entity
@Table(name = "housetype")
@NamedQueries({
    @NamedQuery(name = "HouseType.findAll", query = "SELECT h FROM HouseType h")})
public class HouseType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "HouseTypeID")
    private Integer houseTypeID;
    @Basic(optional = false)
    @Column(name = "HouseTypeName")
    private String houseTypeName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "houseType")
    private List<SellingHouse> sellingHouseList;

    public HouseType() {
    }

    public HouseType(Integer houseTypeID) {
        this.houseTypeID = houseTypeID;
    }

    public HouseType(Integer houseTypeID, String houseTypeName) {
        this.houseTypeID = houseTypeID;
        this.houseTypeName = houseTypeName;
    }

    public Integer getHouseTypeID() {
        return houseTypeID;
    }

    public void setHouseTypeID(Integer houseTypeID) {
        this.houseTypeID = houseTypeID;
    }

    public String getHouseTypeName() {
        return houseTypeName;
    }

    public void setHouseTypeName(String houseTypeName) {
        this.houseTypeName = houseTypeName;
    }

    public List<SellingHouse> getSellingHouseList() {
        return sellingHouseList;
    }

    public void setSellingHouseList(List<SellingHouse> sellingHouseList) {
        this.sellingHouseList = sellingHouseList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (houseTypeID != null ? houseTypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HouseType)) {
            return false;
        }
        HouseType other = (HouseType) object;
        if ((this.houseTypeID == null && other.houseTypeID != null) || (this.houseTypeID != null && !this.houseTypeID.equals(other.houseTypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.com.aptech.msh.entities.HouseType[houseTypeID=" + houseTypeID + "]";
    }

}
